<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use app\portal\model\PortalCategoryModel;
use cmf\controller\HomeBaseController;
use think\Db;

class RecruitController extends HomeBaseController
{

    public function index()
    {
        $portalCategoryModel = new PortalCategoryModel();
        $categorys = $portalCategoryModel->where('parent_id', 11)->where('status', 1)->where("delete_time", "eq", 0)->select();
        $this->assign('categorys', $categorys);
        $this->assign('category', array("id" => 11));

        $data = Db::name('recruit')->order(["list_order" => "ASC", "id" => "DESC"])->select();
        $this->assign("recruits", $data);
        return $this->fetch();
    }

    public function item()
    {
        $pageId = $this->request->param('id', 0, 'intval');
        $data = Db::name('recruit')->find($pageId);
        $this->assign("recruit", $data);
        return $this->fetch();
    }
}

